import { AxiosPromise } from "axios";
import axios  from "../axios";
import Iservice  from "./Iservice";

class  Service implements Iservice{
    query(params?:any):AxiosPromise{
        return   axios({
            method:"get",
            url:"/api/users",
            params
        })
    }
    post(data?:any):AxiosPromise{//注册
        return   axios({
            method:"get",
            url:"/api/users/register",
            data
        })
    }
    login(data?:any):AxiosPromise{//登录
        return   axios({
            method:"post",
            url:"/api/users/login",
            data
        })
    }
}

export default  new  Service();